home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-05-29 | 1.4 KB | 64 lines | [TEXT/KAHL] |
- /****
- * CNDButton.c
- *
- * Copyright © 1992 NeoLogic Systems. All rights reserved.
- *
- ****/
-
- #include "NeoTypes.h"
- #include "CNDButton.h"
- #include "CNDImagePICT.h"
- #include "CNDImageTIFF.h"
- #include "CNDImageGIF.h"
- #include "CNeoDemoDoc.h"
- #include "CNeoDLOGDialog.h"
- #include "CNeoDialogText.h"
-
- /* fill docs image array with all images that match the type in the popup
- and the text in the 'keyword' edit box
- */
- void CNDButton::DoGoodClick(short whichPart)
- {
- short type;
- long length; /* size of search text */
- NeoID classID; /* get from type popup */
- Handle handle; /* search key text handle */
- CNeoDemoDoc * document = ((CNeoDemoDoc *)((CNeoDLOGDialog *)itsSupervisor)->itsSupervisor);
- char string[33]; /* get from 'keyword' box */
-
- /* get key to search for */
- handle = document->fSearchText->GetTextHandle();
- length = GetHandleSize(handle);
- if (length) {
- if (length > 32)
- length = 32;
- NeoBlockMove(*handle, string, length);
- }
- string[length] = 0; /* zero delimited string */
-
- /* could strip leading/trailing blanks, here */
-
- /* get 'type' for searching */
- type = document->getImageType();
-
- switch(type) {
- case kNDImagePICT:
- classID = kNDImagePICTID;
- break;
- case kNDImageTIFF:
- classID = kNDImageTIFFID;
- break;
- case kNDImageGIF:
- classID = kNDImageGIFID;
- break;
- case kNDImage:
- classID = kNDImageID;
- break;
- }
-
- document->setSelectionByKeyword(classID, string);
- }
-
-
-
-